<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <th:block th:if="${type}==0">
    <div data-th-replace="common/functionDepict"></div>
    </th:block>
    <div>
        <div class="row">
            <div class="creat-step-wrap clearfix last_step">
                <div id="abc1" class="col-sm-6">
                    <div class="creat-step-bx">
                        <span class="vam fs24 c-4e"><i class="fa fa-hand-pointer-o"></i></span>
                        <div class="creat-step-txt">
                            <h5><span class="fs18 c-222">第一步：基本信息</span></h5>
                            <span class="fs14 c-999">填写角色的基本信息、名称、职责等</span>
                        </div>
                    </div>
                </div>
                <div id="abc2" class="col-sm-6 creat-step-current">
                    <div class="creat-step-bx">
                        <span class="vam fs24 c-4e"><i class="fa fa-hand-peace-o"></i></span>
                        <div class="creat-step-txt">
                            <h5><span class="fs18 c-222">第二步：权限信息</span></h5>
                            <span class="fs14 c-999">对角色授权，规定角色的操作要求</span>
                        </div>
                    </div>
                </div>
            </div>
            <!--第二步 开始-->
            <div class="pt10">
                <div class="col-sm-9">
                    <div class="ibox float-e-margins">
                        <form id="subjectAndFunctionForm">
                            <input type="hidden" name="roleId" th:value="${roleId}"/>
                            <div class="ibox-title">
                                <h5>角色的权限信息</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <div class="alert alert-warning alert-dismissable m-t">
                                    <strong>提示说明：</strong>
                                    <p>当角色权限重新授权修改后，请退出当前登录账号，重新登录后授于的角色权限才可生效！</p>
                                </div>
                                <h5><span class="c-222 fs14">请选择角色的内容范围</span></h5>
                                <div class="form-horizontal">
                                    <!--<div class="form-group">
                                        <label class="col-sm-2 control-label text-right mt10">项目/专业</label>
                                        <div class="col-sm-8">
                                            <div class="checkbox i-checks">
                                                <label class="mt10"><input id="all-subject" type="checkbox"/> <i></i> 全部专业/科目</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>-->
                                    <!--<div class="all-subjectBox" th:if="${#lists.isEmpty(subjectLayeredList)}==false" th:each="subject : ${subjectLayeredList}">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right mt10 parent-subject-box">
                                                <span class="checkbox i-checks">
                                                    <label><input type="checkbox" th:checked="${subject['hasSubjectStatus']}!=null and ${subject['hasSubjectStatus']}==true" th:value="${subject.id}" name="subjectIds" class="all-subject"/>
                                                    <span th:text="${subject.subjectName}"></span>
                                                    </label>
                                                </span>
                                            </label>
                                            <div class="col-sm-8 child-subject-box">
                                                <div class="checkbox i-checks">
                                                    <label class="mt10" th:each="c : ${subject['childSubjectList']}">
                                                        <input type="checkbox" th:checked="${c['hasSubjectStatus']}!=null and ${c['hasSubjectStatus']}==true" th:value="${c.id}" name="subjectIds" class="all-subject"/>
                                                        <span th:text="${c.subjectName}"></span>
                                                    </label>
                                                    <label th:if="${subject['childSubjectList']}==null or ${#lists.size(subject['childSubjectList'])}==0" class="mt10">
                                                        <span class="help-block m-b-none c-orange ml10" th:text="'【'+${subject.subjectName}"+'】专业下没有子级科目'></span>
                                                    </label>
                                                </div>
                                                <span class="help-block m-b-none c-orange ml10">* 受项目条件影响，默认显示项目下的科目数</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                    </div>-->
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right mt10">选择角色权限</label>
                                        <div class="col-sm-8">
                                            <div class="checkbox i-checks">
                                                <label class="mt10"><input type="checkbox" id="all-function" value=""> <i></i> 全部系统与功能模块</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="all-functionBox" th:each="function : ${functionLayeredList}">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right parent-function-box">
                                                <span class="checkbox i-checks">
                                                    <label>
                                                        <input type="checkbox" th:checked="${function['hasFunctionStatus']}!=null and ${function['hasFunctionStatus']}==true" class="all-function parent-function" name="functionIds" th:value="${function.id}"/>
                                                        <span th:text="${function.functionName}"></span>
                                                    </label>
                                                </span>
                                            </label>
                                            <div class="col-sm-8 child-function-box">
                                                <div class="checkbox i-checks">
                                                    <label class="pt10 show" th:each="child : ${function['childSysFunctionList']}">
                                                        <div class="inline two-level-child">
                                                            <input type="checkbox" th:checked="${child['hasFunctionStatus']}!=null and ${child['hasFunctionStatus']}==true" class="all-function" name="functionIds" th:value="${child.id}" />
                                                            <span th:text="${child.functionName}"></span>
                                                        </div>
                                                        <div class="m-l-md three-level-child">
                                                            <!-- 三级目录-->
                                                            <label class="pt10" th:each="_child,childStat : ${child['childSysFunctionList']}">
                                                                <input type="checkbox" th:checked="${_child['hasFunctionStatus']}!=null and ${_child['hasFunctionStatus']}==true" class="all-function" name="functionIds" th:value="${_child.id}" />
                                                                <span th:text="${_child.functionName}"></span>
                                                                <th:block th:if="${childStat.last}">
                                                                    <br>
                                                                </th:block>
                                                            </label>
                                                        </div>
                                                    </label>

                                                    <label th:if="${function['childSysFunctionList']}==null or ${#lists.size(function['childSysFunctionList'])}==0" class="mt10">
                                                        <span class="help-block m-b-none c-orange ml10" th:text="'【'+${function.functionName}+'】无子级权限'"></span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <a href="javascript:void(0)">
                                                <button class="btn btn-danger" id="save-role-funtion" type="button"> 保存,并授权 </button>
                                            </a>
                                            <button class="btn btn-white ml10" id="cancel-save" type="button">取消</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>重要信息提示</h5>
                        </div>
                        <div class="ibox-content">
                            <p>
                                <span style="font-weight: 700;">1.新建角色为什么分两步？</span>
                            </p>
                            <p>第一步为角色的基本信息，对角色的命名，第二步为角色授权。由于权限较多，所以要分开处理。</p>
                            <p>
                                <span style="font-weight: 700;">2.角色可以不绑定权限吗？</span>
                            </p>
                            <p>如果角色不绑定权限，那么用户对应的角色就没有办法操作系统。</p>
                            <p>
                                <span style="font-weight: 700;">3.角色有什么重要作用吗？</span>
                            </p>
                            <p>角色是权限的集合体，也是公司对自身员工可以操作内容的定位。非常重要，所以创建时要慎重和认真。</p>

                        </div>
                    </div>
                </div>
            </div>
            <!--第二步 结束-->
        </div>
    </div>
</div>
    <!-- 底部引入 -->
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/manage/role/role_function.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script th:inline="javascript" type="text/javascript">
     var typeTo =[[${type}]];
    </script>
</body>
</html>


